home *** CD-ROM | disk | FTP | other *** search
/ How to Get Online 1996 Spring / HOW2GON.ISO / mac / Servers & CGI / CmmCGI / TINYHTML.LIB < prev    next >
Encoding:
Text File  |  1996-02-07  |  877 b   |  31 lines  |  [TEXT/ttxt]

  1. // TinyHTML.LIB - this is a test
  2.  
  3. tag(TagName,Attributes,etc/*...*/)
  4.    // Tagname: HTML tag, e.g. "HTML", "BODY", "FORM"
  5.    // Attributes: attributes for tag, if not supplied or "" or NULL then no attributes
  6.    // etc... this and all other strings appended between <Tagname> and </Tagname>.  If
  7.    //      no etc... then this takes no end tag
  8. {
  9.    ArgCount = va_arg();
  10.    strcat(ret="<",TagName);
  11.    if ( 1 < ArgCount  &&  Attributes  &&  Attributes[0] )
  12.       strcat(ret," ",Attributes);
  13.    strcat(ret,">");
  14.    if ( 2 < ArgCount ) {
  15.       for ( ArgIndex = 2; ArgIndex < ArgCount; ArgIndex++ ) {
  16.          strcat(ret,va_arg(ArgIndex));
  17.       }
  18.       strcat(ret,"</",TagName,">");
  19.    }
  20.    return ret;
  21. }
  22.  
  23. retPrintf(FormatString/*,args*/)
  24. {
  25.    va_start(VaList,FormatString);
  26.    vsprintf(RetStr,FormatString,VaList);
  27.    va_end(VaList);
  28.    return RetStr;
  29. }
  30.  
  31. #define LINEBREAK "<BR>"